<?php
require_once "conn.php";

$account = $_POST["userSno"];
$level = $_POST["level"];
$pwd = $_POST["pwd"];
$time = date("Y-m-d h:i:s");
$name = $_POST["name"];
$classname = $_POST["classname"];

$sql1 = "INSERT INTO `login_info` VALUES ('$account','$level','$pwd','$time');";
$result = $conn->query($sql1);
if ($result === TRUE) {
    echo "新记录插入login成功";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}
$sql2 = "INSERT INTO `user_info` VALUES ('$account','$name','$classname');";
$result2 = $conn->query($sql2);

mysqli_close($conn);
Header("Location: index.php");
